package com.carnation.servlet;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.log4j.Logger;

import com.carnation.utils.SessionUtils;



public class ToUploadServlet extends HttpServlet{

	private static final long serialVersionUID = 1L;
	private Logger logger =Logger.getLogger(ToUploadServlet.class);
	
	protected void doPost(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse){
		if(!SessionUtils.isValid(httpServletRequest, "sessionInfo")){
			//TODO session超时
			logger.info("session超时");
			return ;
		}
		try{
			httpServletRequest.getRequestDispatcher("/SecurityJsp/upload.jsp").forward(httpServletRequest, httpServletResponse);
		}
		catch(Exception e){
			logger.error("跳转失败", e);
		}
	}
	
	protected void doGet(HttpServletRequest httpServletRequest,HttpServletResponse httpServletResponse){
		doPost(httpServletRequest, httpServletResponse);
	}
}
